#include <stdio.h>
#include <stdlib.h>

int main()
{
    printf("hello,please enter the length of the array your want\n");

    int len;
    scanf("%d", &len);

    int * pArr = (int *)malloc(sizeof(int) * len);
    *pArr = 4;//类似于a[0]=4;
    pArr[1] = 10;//类似于a[1]=10;
    printf("Arr[0] = %d Arr[1] = %d\n", *pArr, pArr[1]);
    printf("before free,the length of the array is %d\n", len);

    free(pArr);//把pArr所代表的动态分配的20个字节内存释放

    printf("after free,the length of the array is %d\n", len);

    //int 

    return 0;
}